using System;
using System.Collections.Concurrent;
using System.Runtime.CompilerServices;
using System.Threading;
using Beetle;

internal class at : IDisposable
{
	private ConcurrentQueue<am> m_a = new ConcurrentQueue<am>();

	private am m_b;

	private bool m_c;

	[y("")]
	public static string d;

	[f]
	public static string e;

	internal static Timer f;

	public int g = 1;

	static at()
	{
		at.d = "KntezZn3/HTLy0OE4rsKQJAtd7Q9rU8fhn1//PZnJ+RTNMXQ+MkO6QwQJqnn3RqN9ou6CzyfMrZWjXY9HyYCHRZ3CSvJyMY1qvMp1J9trG64OxZeCVcYGpObKBlmULBtct+eQl7GpmLt7sW4mdDuXyYWKu7XJjY893CstYfSgZa9qJnxayzFELm0iQbGDtho3l/Kp1MxUKteGuVzjquNBHG3HeJKbtv1uItsbIZ7vsIwmYb26IybmgjrUY7lPR62sbWxQr+v44PgM6AW4P1g4Q9Fs3e5Eer6O9WW1VeBO9XxxhIpvj6ardz8oC6rr5HNii7ip/k9WkSr3FT9sCkrtF4KnD7tnlkFluByl9Yk0IObLEiaZX9ZxYeXjd5jqITrieIJBe9IoCJc+zakXnuDoVWG0Wrxg1/d4QIJAHqo+6lwjPJAW9j7zyzbCSoL/k5YBrEWn92HYhZjW1aFh3SGVJ8wNgnmLj7BsNiozlP2mA2GpGyXLf7D1oSSl6Ycf/ynPDeUCBf+3ZcuF/czpArdNKjPeo24AoEYSDP+ZGvTHIw=";
		at.e = "baxxfKKgHV9XwOpsrn1uYA==";
		global::g.g();
	}

	public at()
	{
		WaitCallback callBack = delegate
		{
			f();
		};
		ThreadPool.QueueUserWorkItem(callBack);
		a();
	}

	public static void b()
	{
		if (at.f != null)
		{
			at.f.Dispose();
			at.f = null;
		}
	}

	public static void a()
	{
		if (at.f == null)
		{
			at.f = new Timer(@as.a, null, 30000, 30000);
		}
	}

	public void a(am A_0)
	{
		this.m_a.Enqueue(A_0);
	}

	protected am c()
	{
		am result = null;
		if (!this.m_a.TryDequeue(out result))
		{
			result = null;
		}
		return result;
	}

	[SpecialName]
	public int e()
	{
		return this.m_a.Count;
	}

	protected virtual void d()
	{
		this.m_b = c();
		if (this.m_b != null)
		{
			try
			{
				using (this.m_b)
				{
					this.m_b.a();
					return;
				}
			}
			catch
			{
				return;
			}
		}
		Thread.Sleep(g);
	}

	public virtual void f()
	{
		TcpUtils.a();
		while (!this.m_c)
		{
			d();
		}
	}

	public void Dispose()
	{
		lock (this)
		{
			if (!this.m_c)
			{
				am result = null;
				while (this.m_a.TryDequeue(out result))
				{
					result.Dispose();
				}
				this.m_c = true;
			}
		}
	}

	[CompilerGenerated]
	private void a(object A_0)
	{
		f();
	}
}
